package com.fenghongzhang.module_home.ui.recommend

import com.fenghongzhang.lib_base.core.BaseRepository
import com.fenghongzhang.module_home.HomeApiService
import com.fenghongzhang.module_home.HomeUIState
import javax.inject.Inject


class RecommendRepository @Inject constructor(): BaseRepository(){
    @Inject
    lateinit var apiService: HomeApiService

    suspend fun getRecyclerviewData(): Result<RecommendUIState>{
        val res = apiService.getRecommendMutilVideo(1,10)
        return if (res.code == 200) {
            Result.success(RecommendUIState(recommendMutilVideo = res.data, isSucess = true))
        } else {
            Result.failure(IllegalArgumentException("没有数据"))
        }
    }

}